﻿using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;

namespace YL.Core.Entity.Fluent.Validation
{
    public class UserFluent : AbstractValidator<Whr_user>
    {
        public UserFluent() 
        {
            RuleFor(u => u.Mobile).NotNull().NotEmpty().WithMessage("手机号码不能为空")
                .Matches(@"^1[3456789]\d{9}$").WithMessage("手机号码不正确");
            RuleFor(u => u.Password).Length(6, 16).WithMessage("密码为6到16个字符");
        }
    }
}
